home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / webbrwsr / nsIPrintingPrompt.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  13KB  |  265 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIPrintingPrompt.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIPrintingPrompt_h__
  6. #define __gen_nsIPrintingPrompt_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. #ifndef __gen_nsIWebBrowserPrint_h__
  14. #include "nsIWebBrowserPrint.h"
  15. #endif
  16.  
  17. #ifndef __gen_nsIWebProgressListener_h__
  18. #include "nsIWebProgressListener.h"
  19. #endif
  20.  
  21. #ifndef __gen_nsIPrintSettings_h__
  22. #include "nsIPrintSettings.h"
  23. #endif
  24.  
  25. #ifndef __gen_nsIPrintProgressParams_h__
  26. #include "nsIPrintProgressParams.h"
  27. #endif
  28.  
  29. #ifndef __gen_nsIObserver_h__
  30. #include "nsIObserver.h"
  31. #endif
  32.  
  33. /* For IDL files that don't want to include root IDL files. */
  34. #ifndef NS_NO_VTABLE
  35. #define NS_NO_VTABLE
  36. #endif
  37.  
  38. /* starting interface:    nsIPrintingPrompt */
  39. #define NS_IPRINTINGPROMPT_IID_STR "44e314ca-75b1-4f3d-9553-9b3507912108"
  40.  
  41. #define NS_IPRINTINGPROMPT_IID \
  42.   {0x44e314ca, 0x75b1, 0x4f3d, \
  43.     { 0x95, 0x53, 0x9b, 0x35, 0x07, 0x91, 0x21, 0x08 }}
  44.  
  45. class NS_NO_VTABLE nsIPrintingPrompt : public nsISupports {
  46.  public: 
  47.  
  48.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IPRINTINGPROMPT_IID)
  49.  
  50.   /**
  51.    *  This service enables embedders to implement their own Print and Progress Dialogs.
  52.    *  Each platform has a "base" or "basckstop" implementation of the service. The 
  53.    *  service is automatically registered at start up.
  54.    *
  55.    *  Historically, platform toolkits with native dialogs have implemented them in the GFX layer
  56.    *  Usually they were displayed when a new DeviceContextSpec specific to that platform
  57.    *  was created.
  58.    *
  59.    *  Windows: The GFX layer no longers supports default toolkit behavior for displaying the 
  60.    *           native Print Dialog.
  61.    *           If an embedder implemented service returns any error code (other than NS_ERROR_ABORT)
  62.    *           printing will terminate.
  63.    *
  64.    *           Returning NS_OK assumes that the PrintSettings object was correctly filled in and
  65.    *           if it does not have valid fields for printer name, etc. it may also terminate.
  66.    *
  67.    *           Defaults for platform service:           
  68.    *             showPrintDialog       - displays a native dialog
  69.    *             showPageSetup         - displays a XUL dialog
  70.    *             showProgress          - displays a XUL dialog
  71.    *             showPrinterProperties - n/a
  72.    *
  73.    *           Summary for Windows Embedders:
  74.    *             Stated once again: There is no "fallback" native platform support in GFX for the
  75.    *             displaying of the native print dialog. The current default implementation for Windows
  76.    *             display a native print dialog but a XUL-based progress dialog.
  77.    *             If you wish to have a native progress dialog on Windows you will have to create and 
  78.    *             register your own service.
  79.    *  
  80.    *             Note: The Windows version Mozilla implements this service which is 
  81.    *                   automatically built and registered for you. You can use it as an example.
  82.    *                   It is located at "mozilla/embedding/components/printingui/src/win". That service
  83.    *                   is capable of displaying a native print dialog and a XUL progress dialog.
  84.    *
  85.    *             To fly your own dialog you may:
  86.    *
  87.    *              1) Implement this service to display at least the Print Dialog and a Print Progress Dialog
  88.    *                 or you may implement just one of the dialogs and pass back NS_ERROR_NOT_IMPLEMENTED
  89.    *                 for any of the others.
  90.    *
  91.    *              2) For the Print Dialog:
  92.    *                 You may stub out this service by having all the methods return NS_ERROR_NOT_IMPLEMENTED.
  93.    *                 You can then fly you own dialog and then properly fill in the PrintSettings object
  94.    *                 before calling nsIWebBrowserPrint's Print method. If you stub out this service  
  95.    *                 you MUST set "printSilent" to true, if you do not, Printing will terminate and an 
  96.    *                 error dialog will be displayed.
  97.    *
  98.    *  Mac: The GFX layer still supports default toolkit behavior for displaying the Print Dialog.
  99.    *       If an embedder implemented service returns NS_ERROR_NOT_IMPLEMENTED for "showPrintDialog"
  100.    *       The toolkit will display the native print dialog.
  101.    *
  102.    *       Defaults for platform service:           
  103.    *       Mac OS9: showPrintDialog       - displays a native dialog
  104.    *                showPageSetup         - displays a native dialog
  105.    *                showProgress          - displays a XUL dialog
  106.    *                showPrinterProperties - n/a
  107.    *                
  108.    *       Mac OSX: showPrintDialog       - displays a native dialog
  109.    *                showPageSetup         - displays a native dialog
  110.    *                showProgress          - not implemented (provided by OS)
  111.    *                showPrinterProperties - n/a
  112.    *                
  113.    *  GTK: There are no native dialog for GTK.
  114.    *
  115.    *       Defaults for platform service:           
  116.    *         showPrintDialog       - displays a XUL dialog
  117.    *         showPageSetup         - displays a XUL dialog
  118.    *         showProgress          - displays a XUL dialog
  119.    *         showPrinterProperties - displays a XUL dialog
  120.    *              
  121.    *  OS2: 
  122.    *
  123.    *       Defaults for platform service:           
  124.    *         showPrintDialog       - displays a XUL dialog
  125.    *         showPageSetup         - displays a XUL dialog
  126.    *         showProgress          - displays a XUL dialog
  127.    *         showPrinterProperties - displays a native dialog
  128.    *              
  129.    *
  130.    */
  131. /**
  132.    *  Show the Print Dialog 
  133.    *
  134.    *  @param webBrowserPrint - represents the document to be printed
  135.    *  @param printSettings - PrintSettings for print "job"
  136.    *
  137.    */
  138.   /* void showPrintDialog (in nsIWebBrowserPrint webBrowserPrint, in nsIPrintSettings printSettings); */
  139.   NS_IMETHOD ShowPrintDialog(nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings) = 0;
  140.  
  141.   /**
  142.    *  Shows the print progress dialog
  143.    *
  144.    *  @param webBrowserPrint - represents the document to be printed
  145.    *  @param printSettings - PrintSettings for print "job"
  146.    *  @param openDialogObserver - an observer that will be notifed when the dialog is opened
  147.    *  @param isForPrinting - true - for printing, false for print preview
  148.    *  @param webProgressListener - additional listener can be registered for progress notifications
  149.    *  @param printProgressParams - parameter object for passing progress state
  150.    *  @param notifyOnOpen - this indicates that the observer will be notified when the progress
  151.    *                        dialog has been opened. If false is returned it means the observer
  152.    *                        (usually the caller) shouldn't wait
  153.    *                        For Print Preview Progress there is intermediate progress
  154.    */
  155.   /* void showProgress (in nsIWebBrowserPrint webBrowserPrint, in nsIPrintSettings printSettings, in nsIObserver openDialogObserver, in boolean isForPrinting, out nsIWebProgressListener webProgressListener, out nsIPrintProgressParams printProgressParams, out boolean notifyOnOpen); */
  156.   NS_IMETHOD ShowProgress(nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings, nsIObserver *openDialogObserver, PRBool isForPrinting, nsIWebProgressListener **webProgressListener, nsIPrintProgressParams **printProgressParams, PRBool *notifyOnOpen) = 0;
  157.  
  158.   /**
  159.    *  Shows the print progress dialog
  160.    *
  161.    *  @param printSettings - PrintSettings for page setup (required)
  162.    *  @param aObs - An observer to know if the contents of the Print Settings 
  163.    *                object has changed while the dialog is being shown. 
  164.    *                For example, some platforms may implement an "Apply" button (not required)
  165.    */
  166.   /* void showPageSetup (in nsIPrintSettings printSettings, in nsIObserver aObs); */
  167.   NS_IMETHOD ShowPageSetup(nsIPrintSettings *printSettings, nsIObserver *aObs) = 0;
  168.  
  169.   /**
  170.    *  Sometimes platforms need to bring up a special properties dialog for showing
  171.    *  print specific properties. Although the PrintSettings has a place to set the 
  172.    *  printer name, here is is an argument to be clear as to what printer is being
  173.    *  asked to have the properties set for it. The Printer name in the PS is ignored.
  174.    *
  175.    *  @param printerName - name of printer (required)
  176.    *  @param printSettings - PrintSettings for page setup (required)
  177.    */
  178.   /* void showPrinterProperties (in wstring printerName, in nsIPrintSettings printSettings); */
  179.   NS_IMETHOD ShowPrinterProperties(const PRUnichar *printerName, nsIPrintSettings *printSettings) = 0;
  180.  
  181. };
  182.  
  183. /* Use this macro when declaring classes that implement this interface. */
  184. #define NS_DECL_NSIPRINTINGPROMPT \
  185.   NS_IMETHOD ShowPrintDialog(nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings); \
  186.   NS_IMETHOD ShowProgress(nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings, nsIObserver *openDialogObserver, PRBool isForPrinting, nsIWebProgressListener **webProgressListener, nsIPrintProgressParams **printProgressParams, PRBool *notifyOnOpen); \
  187.   NS_IMETHOD ShowPageSetup(nsIPrintSettings *printSettings, nsIObserver *aObs); \
  188.   NS_IMETHOD ShowPrinterProperties(const PRUnichar *printerName, nsIPrintSettings *printSettings); 
  189.  
  190. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  191. #define NS_FORWARD_NSIPRINTINGPROMPT(_to) \
  192.   NS_IMETHOD ShowPrintDialog(nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings) { return _to ShowPrintDialog(webBrowserPrint, printSettings); } \
  193.   NS_IMETHOD ShowProgress(nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings, nsIObserver *openDialogObserver, PRBool isForPrinting, nsIWebProgressListener **webProgressListener, nsIPrintProgressParams **printProgressParams, PRBool *notifyOnOpen) { return _to ShowProgress(webBrowserPrint, printSettings, openDialogObserver, isForPrinting, webProgressListener, printProgressParams, notifyOnOpen); } \
  194.   NS_IMETHOD ShowPageSetup(nsIPrintSettings *printSettings, nsIObserver *aObs) { return _to ShowPageSetup(printSettings, aObs); } \
  195.   NS_IMETHOD ShowPrinterProperties(const PRUnichar *printerName, nsIPrintSettings *printSettings) { return _to ShowPrinterProperties(printerName, printSettings); } 
  196.  
  197. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  198. #define NS_FORWARD_SAFE_NSIPRINTINGPROMPT(_to) \
  199.   NS_IMETHOD ShowPrintDialog(nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings) { return !_to ? NS_ERROR_NULL_POINTER : _to->ShowPrintDialog(webBrowserPrint, printSettings); } \
  200.   NS_IMETHOD ShowProgress(nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings, nsIObserver *openDialogObserver, PRBool isForPrinting, nsIWebProgressListener **webProgressListener, nsIPrintProgressParams **printProgressParams, PRBool *notifyOnOpen) { return !_to ? NS_ERROR_NULL_POINTER : _to->ShowProgress(webBrowserPrint, printSettings, openDialogObserver, isForPrinting, webProgressListener, printProgressParams, notifyOnOpen); } \
  201.   NS_IMETHOD ShowPageSetup(nsIPrintSettings *printSettings, nsIObserver *aObs) { return !_to ? NS_ERROR_NULL_POINTER : _to->ShowPageSetup(printSettings, aObs); } \
  202.   NS_IMETHOD ShowPrinterProperties(const PRUnichar *printerName, nsIPrintSettings *printSettings) { return !_to ? NS_ERROR_NULL_POINTER : _to->ShowPrinterProperties(printerName, printSettings); } 
  203.  
  204. #if 0
  205. /* Use the code below as a template for the implementation class for this interface. */
  206.  
  207. /* Header file */
  208. class nsPrintingPrompt : public nsIPrintingPrompt
  209. {
  210. public:
  211.   NS_DECL_ISUPPORTS
  212.   NS_DECL_NSIPRINTINGPROMPT
  213.  
  214.   nsPrintingPrompt();
  215.  
  216. private:
  217.   ~nsPrintingPrompt();
  218.  
  219. protected:
  220.   /* additional members */
  221. };
  222.  
  223. /* Implementation file */
  224. NS_IMPL_ISUPPORTS1(nsPrintingPrompt, nsIPrintingPrompt)
  225.  
  226. nsPrintingPrompt::nsPrintingPrompt()
  227. {
  228.   /* member initializers and constructor code */
  229. }
  230.  
  231. nsPrintingPrompt::~nsPrintingPrompt()
  232. {
  233.   /* destructor code */
  234. }
  235.  
  236. /* void showPrintDialog (in nsIWebBrowserPrint webBrowserPrint, in nsIPrintSettings printSettings); */
  237. NS_IMETHODIMP nsPrintingPrompt::ShowPrintDialog(nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings)
  238. {
  239.     return NS_ERROR_NOT_IMPLEMENTED;
  240. }
  241.  
  242. /* void showProgress (in nsIWebBrowserPrint webBrowserPrint, in nsIPrintSettings printSettings, in nsIObserver openDialogObserver, in boolean isForPrinting, out nsIWebProgressListener webProgressListener, out nsIPrintProgressParams printProgressParams, out boolean notifyOnOpen); */
  243. NS_IMETHODIMP nsPrintingPrompt::ShowProgress(nsIWebBrowserPrint *webBrowserPrint, nsIPrintSettings *printSettings, nsIObserver *openDialogObserver, PRBool isForPrinting, nsIWebProgressListener **webProgressListener, nsIPrintProgressParams **printProgressParams, PRBool *notifyOnOpen)
  244. {
  245.     return NS_ERROR_NOT_IMPLEMENTED;
  246. }
  247.  
  248. /* void showPageSetup (in nsIPrintSettings printSettings, in nsIObserver aObs); */
  249. NS_IMETHODIMP nsPrintingPrompt::ShowPageSetup(nsIPrintSettings *printSettings, nsIObserver *aObs)
  250. {
  251.     return NS_ERROR_NOT_IMPLEMENTED;
  252. }
  253.  
  254. /* void showPrinterProperties (in wstring printerName, in nsIPrintSettings printSettings); */
  255. NS_IMETHODIMP nsPrintingPrompt::ShowPrinterProperties(const PRUnichar *printerName, nsIPrintSettings *printSettings)
  256. {
  257.     return NS_ERROR_NOT_IMPLEMENTED;
  258. }
  259.  
  260. /* End of implementation class template. */
  261. #endif
  262.  
  263.  
  264. #endif /* __gen_nsIPrintingPrompt_h__ */
  265.